<template>
    <view>
		<view>
			<table-title content="收楼意见"></table-title>
			<view class="in-center">
			    <small-title content="基本资料"></small-title>
			    <view class="state-bar">
			        <view class="state-msg">{{state}}</view>
			    </view>
			</view>
			<view class="item-table">
			    <view-item name="申请人" :value="userName"></view-item>
			    <view-item name="手机号码" :value="userPhone"></view-item>
			    <view-item name="租户名称" :value="company"></view-item>
			    <view-item name="楼盘" :value="building"></view-item>
			    <view-item name="单元" :isLast="true" :value="room"></view-item>
			</view>
			<view>
			    <small-title content="需整改内容"></small-title>
			    <change-table number="序号" changeContent="需整改项目及内容"></change-table>
			    <change-table v-for="(n,index) in changeList.length" :number="(n).toString()" :key="index" 
			        :changeContent="changeList[n-1]" :isLast="n===changeList.length?true:false"></change-table>
			</view>
			<view>
			    <small-title content="整改意见"></small-title>
			    <change-table number="序号" changeContent="整改意见"></change-table>
			    <change-table v-for="(n,index) in changeList.length" :number="(n).toString()" :key="index" 
			        :changeContent="changeList[n-1]" :isLast="n===changeList.length?true:false"></change-table>
			</view>
			<view>
			    <small-title content="处理进度"></small-title>
			    <proccess-bar :proccessList="proccessList"></proccess-bar>
			</view>
			<view class="mix-button">
			    <view class="left-part">
			        <button class="left-button">收房</button>
			    </view>
			    <view class="right-part">
			        <button class="right-button">返回</button>
			    </view>
			</view>
			<view style="height: 200rpx;"></view>
		</view>
		<u-tabbar v-model="current" :list="list" :before-switch="clickTabbar"></u-tabbar>
    </view>
</template>

<script>
    export default{
        data() {
            return {
                userName: '李阳',
                userPhone: '18705015193',
                company: '福建海峡科技有限公司',
                building: '福建八闽大厦',
                room: '901',
                changeList:['墙面脱落','窗帘破损'],
                opinionList:['安排工人重新粉刷','更换新窗帘'],
                proccessList:[
                    {'type':'firstCanvas','commentMsg':'提交收楼意见','time':'2021-01-01 01:01:11'},
                    {'type':'lastCanvas','commentMsg':'已受理','time':'2020-03-03 03:33:33'}
                ],
                state: '已受理',
				list: [
					{
						iconPath: "home",
						selectedIconPath: "home-fill",
						text: '首页',
						customIcon: false,
					},
					{
						iconPath: "photo",
						selectedIconPath: "photo-fill",
						text: '管家',
						customIcon: false,
					},
					{
						iconPath: "https://cdn.uviewui.com/uview/common/min_button.png",
						selectedIconPath: "https://cdn.uviewui.com/uview/common/min_button_select.png",
						text: '发现',
						customIcon: false,
					},
					{
						iconPath: "play-right",
						selectedIconPath: "play-right-fill",
						text: '消息',
						count: 23,
						customIcon: false,
					},
					{
						iconPath: "account",
						selectedIconPath: "account-fill",
						text: '我的',
					},
				],
				current: 0
            }
        },
		methods: {
			clickTabbar(index) {
				switch(index){
					case 0:
						console.log('首页')
						uni.redirectTo({
							url:'/pages/home/home'
						})
						return true
						break
					case 1:
						console.log('管家')
						return true
						break
					case 2:
						console.log('发现')
						return true
						break
					case 3:
						console.log('消息')
						uni.redirectTo({
							url:'/pages/systemAnnoucement/list/list'
						})
						return true
						break
					case 4:
						console.log('我的')
						uni.navigateTo({
							url:'/pages/myPage/myPage'
						})
						return true
						break
				}
			}
		},
    }
</script>

<style>
	.in-center{
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	.mix-button{
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.left-part{
		float: right;
	}
	.right-part{
		float: left;
	}
	.left-button{
		background-color: #FF0000;
		border-radius: 50rpx 0 0 50rpx;
		color: #FFFFFF;
		width: 300rpx;
		font-size: 30rpx;
	}
	.right-button{
		background-color: #0000FF;
		border-radius: 0 50rpx 50rpx 0;
		color: #FFFFFF;
		width: 300rpx;
		font-size: 30rpx;
	}
	.item-table{
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.state-bar{
		align-items: center;
		color: #FFFFFF;
		background-color: #DD524D;
		width: 160rpx;
		justify-content: flex-end;
		margin-left: auto;
		margin-right: 50rpx;
		font-size: 30rpx;
		border-radius: 50rpx;
	}
	.state-msg{
		display: flex;
		align-items: center;
		justify-content: center;
	}
</style>